#lang racket


(require "../base/base.rkt")

(require "domain.rkt"
         "curve.rkt")


(provide (struct-out arc-curve)
         make-arc-curve)


(define-struct (arc-curve curve)
  (angle radius)
  #:constructor-name new-arc-curve)

(define (parametric-arc-object angle radius)
  (λ (t)
    (pol radius t)))

(define (parametric-arc-tangent angle radius)
  (λ (t)
    (error 'parametric-arc-tangent "Closure not implemented")))

(define (parametric-arc-normal angle radius)
  (λ (t)
    (error 'parametric-arc-normal "Closure not implemented")))

(define (parametric-arc-binormal angle radius)
  (λ (t)
    (error 'parametric-arc-binormal "Closure not implemented")))


(define (make-arc-curve angle radius)
  (when (< angle 0)
    (error 'make-arc-curve "Angle must be greater than or equal to 0"))
  (when (<= radius 0)
    (error 'make-arc-curve "Radius must be greater than 0"))
  (new-arc-curve
   (parametric-arc-object angle radius)
   (parametric-arc-tangent angle radius)
   (parametric-arc-normal angle radius)
   (parametric-arc-binormal angle radius)
   (make-t-domain 'closed 0 'closed angle)
   angle
   radius))